# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=json-glib
pkgver=1.2.8
pkgrel=1
pkgdesc="JSON library built on GLib"
url="https://wiki.gnome.org/Projects/JsonGlib"
arch=(i686 x86_64)
license=(GPL)
depends=(glib2)
makedepends=(gobject-introspection git gtk-doc meson)
_commit=f97b6ca9c684bc7adf9b07043b62ecd7443272fc  # tags/1.2.8^0
source=("git+https://git.gnome.org/browse/json-glib#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
}

build() {
  cd build
  export LANG=en_US.UTF-8
  meson --prefix=/usr --buildtype=release ../$pkgname --libexecdir=/usr/lib \
    -Denable-gtk-doc=true -Denable-man=true
  ninja
}

check() {
  cd build
  ninja test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
